package com.woniu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.entity.RoleMidMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hyl
 * @since 2022-08-28
 */
public interface RoleMidMenuMapper extends BaseMapper<RoleMidMenu> {

    @Insert("insert into role_mid_menu (role_id , menu_id) values (#{roleId} , #{menuId})")
    void insert(@Param("roleId") int roleId, @Param("menuId") int menuId);

    @Delete("delete from role_mid_menu where role_id = #{roleId}")
    void deleteMenusByRoleId(int roleId);
}
